//
//  EditImage.h
//  MultiViewDemo
//
//  Created by Ngoc on 4/30/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "WEPopoverController.h"
#import "WEPopoverParentView.h"
#import "GeMenu.h"
#import "CanvasViewController.h"

typedef enum menu
{
    None,
    Edit,
  //  Draw,
    Filter,
    Border,
    Home,
    
}Menu;
@interface EditImageController : UIViewController<CellSelectedHandler,UIScrollViewDelegate> {
    
    UIImageView *imageView_;
    NSArray *menuList;
    WEPopoverController *popoverController;
    
    UIBarButtonItem *redoBarBtnItem, *undoBarBtnItem,*okBarBtnItem,*cancelBarBtnItem;
    
    UIToolbar *bottomToolbar;
    
    Menu currentMenu;
    BOOL showToolBar;
    
}

@property (nonatomic, retain) WEPopoverController *popoverController;
@property (nonatomic, retain) UIImageView *imageView;
@property (nonatomic, retain) IBOutlet UIScrollView *imageScrollView;
@property(nonatomic, retain) UIViewController *parentController;
@property(nonatomic, retain) NSArray *menuList;
@property(nonatomic, retain) UIBarButtonItem *redoBarBtnItem;
@property(nonatomic, retain) UIBarButtonItem *undoBarBtnItem;
@property(nonatomic, retain) UIBarButtonItem *okBarBtnItem;
@property(nonatomic, retain) UIBarButtonItem *cancelBarBtnItem;
@property(nonatomic, retain) IBOutlet UIToolbar *bottomToolbar;



@property (nonatomic, retain) IBOutlet UIBarButtonItem *btnSave;

-(IBAction) showEditMenu:(id) sender;
//-(IBAction) showDrawMenu:(id) sender;
-(IBAction) showFilterMenu:(id) sender;
-(IBAction) showBorderMenu:(id) sender;
-(IBAction) showHomeMenu:(id) sender;

+(EditImageController*) sharedInstance;
-(void) oneFingerOneTapHandler;
-(void) longPressHandler;
-(void) homeViewPrepare;
-(void) showMenu:(Menu) menu anchorRect:(CGRect) locationRect withSize:(CGSize) size withArrowDirection:(UIPopoverArrowDirection) direction;
-(void) returnParentView;
-(void) setInputData:(UIImage*) image;
-(void) showOrHideUndoRedoBarButtonItem:(BOOL) hide;
-(void) showOrHideOkCancelBarButtonItem:(BOOL)hide;
- (CGRect)zoomRectForScale:(float)scale withCenter:(CGPoint)center;
-(void) imageViewSetUp;
@end
 